package com.sgb.goods.view.adapter.publish;

import androidx.databinding.ViewDataBinding;

import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.goods.BR;
import com.sgb.goods.R;
import com.sgb.goods.entity.MenuEntity1;
import com.sgb.goods.utils.StringUtils;
import com.sgb.goods.utils.base.adapter.RecordPointCommonAdapter;

/**
 * 商品类型选择左侧适配器
 * @author cyj
 */
public class GoodsTypeLeftAdapter extends RecordPointCommonAdapter<MenuEntity1<MenuEntity1<MenuEntity1>>> {

    public GoodsTypeLeftAdapter() {
        super(R.layout.goods_item_goods_type_left, BR.viewModel);
    }

    @Override
    protected void convert(BaseViewHolder baseHolder, ViewDataBinding dataBinding, MenuEntity1<MenuEntity1<MenuEntity1>> entity) {
    }

    @Override
    public boolean equivalentToObject(MenuEntity1<MenuEntity1<MenuEntity1>> object1, MenuEntity1<MenuEntity1<MenuEntity1>> object2) {
        if(null == object1 || null == object2) {
            return false;
        }
        // 重写对象相同的条件，用于记录节点下次进入显示与找寻对应的item项
        return !StringUtils.isEmpty(object1.id) && object1.id.equals(object2.id);
    }
}
